package com.develop.collection;

import com.develop.collection.util.Entry;
import com.develop.jdbc.jdbc.session.Session;
import com.develop.jdbc.jdbc.session.SessionFactory;

public class Main {

    public static void main(String[] args) {
        Entry.entry(() -> {
            Session session = SessionFactory.getSession();
            String[] groups = session.queryStringArray("SELECT CD_GROUPS FROM COM_DICTIONARIES group by CD_GROUPS");
            String group;
            for (int i = 0; i < groups.length; i++) {
                group = groups[i];
                Object[] obj = {group};
                System.out.println(String.join(",", session.queryStringArray("select CD_NAME name from COM_DICTIONARIES WHERE CD_GROUPS=?", obj)));
            }


            session.close();
            session = SessionFactory.getSession("zhongc");
            System.out.println(session.queryInt("select count(1) from JBXX_ZiRanXinXi where deleted=0"));
            session.close();
        });
    }
}
